<template>
  <div>
    <van-cell title="历史记录">
      <!-- 使用 right-icon 插槽来自定义右侧图标 -->
      <template #right-icon>
        <van-icon name="close" class="search-icon" @click="removeAllHistory" />
      </template>
    </van-cell>
    <van-cell-group>
      <van-cell v-for="(item, idx) in list" :key="item" center>
        {{ item }}
        <template #right-icon>
          <van-icon
            name="close"
            @click.stop="onRemoveLastSearchListItem(idx)"
          />
        </template>
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
export default {
  props: {
    value: String,
    list: Array,
    isShow: Boolean,
  },
  data() {
    return {
      
    };
  },
  methods: {
    onRemoveLastSearchListItem(idx) {
      this.$emit("onRemoveLastSearchListItem", idx);
    },
    removeAllHistory() {
      this.$emit("removeAllHistory");
    }
  },
};
</script>

<style scoped>
</style>